<html>
<head>
    <title>Dates</title>
</head>
<body>
<form action="" method="post">
    <textarea name="value" rows="5" cols="50"><?php echo @$_POST['value'];?></textarea>
    <br>
    <input type="submit" value="Submit">
</form>

<?php

    if (@$_POST['value']) {

        if ((int)$_POST['value'] == 0) {
            $_POST['value'] = strtotime($_POST['value']);
        }
        
        JBDump::timestamp($_POST['value']);
        JBDump(time() .' sec = '.date(DATE_RFC822, time()), 0, 'Current date');
        JBDump(time() - $_POST['value'] .' sec', 0, 'time() - $value');
        
        echo '<hr>';
        $consts = get_defined_constants(true);
        foreach($consts['date'] as $key => $const) {
            if (strpos($key, 'DATE_') === 0) {
                JBDump(date($const, $_POST['value']), 0, $key.'  '.$const);
            } 
        }
        
    }
?>

</body>
</html>

